<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>二维数组，求最大值，以及行列坐标</title>
	</head>
	<body>
		<script type="text/javascript">
			let arr = [
				[1, 2, 3, 4],
				[5, 6, 7, 8],
				[9, 10, 11, 12]
			]
			let num = Number.MIN_SAFE_INTEGER;
			let x,y;
			for (let i = 0; i < arr.length; i++) {
				for (let j = 0; j < arr[i].length; j++) {
					if(arr[i][j] > num){
						num = arr[i][j];
						x = j;
						y = i;
					}
				}
			}
			console.log({x,y})
		</script>
	</body>
</html>
